package Thread;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingDeque;

//阻塞队列,队列空阻塞，对列满阻塞，没有取队首原损功能(线程安全)
public class ThreadDemo16 {
    public static void main(String[] args) throws InterruptedException {
        //LinkedBlockingDeque<>()基于链表来实现的
        BlockingQueue queue =new LinkedBlockingDeque<>();
        queue.put("hi");//put带有阻塞功能，offer没有
        queue.take();

    }
}
